import pymysql


con = pymysql.connect(host='localhost', user='root', password='123456', database='1_test', port=3306,
                      charset='utf8')
try:
    with con.cursor() as cursor:
        sql1 = 'create table net(''yidong varchar(30),' 'liantong varchar(30),' 'dianxin varchar(30)' \
               ');'
        cursor.execute(sql1)
        cursor.execute('show tables')
        cursor.execute("desc net")
finally:
    con.close()
print("数据表net创建成功！")